package com.genexususa.eo.bing.data.wsSubclasses;

import com.genexususa.eo.bing.CampaignManagementServiceClasses.StateTarget;
import com.genexususa.eo.bing.CampaignManagementServiceClasses.StateTargetBid;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

public class GxStateTarget extends StateTarget {
    public GxStateTarget(Element element) {
        NodeList bidsNode = element.getElementsByTagName("StateTargetBidCollection");
        if (bidsNode.getLength() > 0) {
            NodeList stateTargetBidNode = ((Element)bidsNode.item(0)).getElementsByTagName("StateTargetBid");
            StateTargetBid[] stateTargetBids = new StateTargetBid[stateTargetBidNode.getLength()];
            for (int temp = 0; temp < stateTargetBidNode.getLength(); temp++) {
                stateTargetBids[temp] = new GxStateTargetBid((Element)stateTargetBidNode.item(temp));
            }
            this.setBids(stateTargetBids);
        }
    }
}
